const user = {
  state :{
    bankCard:0,
    name:"",
    status:1, // 1未插卡，2已插卡，3查询交易记录，4取款，5存款，6转账, 7 余额查询
    currentStatus:1,
  },

  mutations:{
    SET_BANKCARD: (state, bankCard) =>{
      state.bankCard = bankCard
    },
    SET_STATUS: (state, status) =>{
      state.status = status
    },
    REMOVE_ALL: (state) =>{
      state.bankCard = 0
      state.status = 0
    }
  },

  actions: {
    userLogin({commit}, bankCard) {
      commit('SET_BANKCARD', bankCard)
      commit("SET_STATUS", 1)
    },

    removeAll({commit}){
      commit("REMOVE_ALL")
    },

    setStatus({commit}, status){
      commit("SET_STATUS", status)
    }
  }

}

export default user
